import request from '@/utils/request'

// 查询B2B销售订单信息列表
export function listOrder2B(query) {
  return request({
    url: '/sales/order2B/list',
    method: 'post',
    data: query
  })
}

// 查询销售冻结明细信息列表
export function listOrder2BFreeze(query) {
  return request({
    url: '/sales/order2B/listFreeze',
    method: 'post',
    data: query
  })
}

// 查询B2B销售订单信息详细
export function getOrder2B(id) {
  return request({
    url: '/sales/order2B/' + id,
    method: 'get'
  })
}

// 查询销售订单状态统计信息
export function findOrder2BStatusCount(query) {
  return request({
    url: '/sales/order2B/findOrder2BStatusCount',
    method: 'post',
    data: query
  })
}

// 新增B2B销售订单信息
export function addOrder2B(data) {
  return request({
    url: '/sales/order2B/add',
    method: 'post',
    data: data
  })
}

// 修改B2B销售订单信息
export function updateOrder2B(data) {
  return request({
    url: '/sales/order2B/update',
    method: 'post',
    data: data
  })
}

// 删除B2B销售订单信息
export function delOrder2B(id) {
  return request({
    url: '/sales/order2B/delete/' + id,
    method: 'post'
  })
}
//审核B2B订单
export function audit(id){
  return request({
    url: '/sales/order2B/audit/' + id,
    method: 'post'
  })
}
//审核B2B订单
export function auditCancel(id){
  return request({
    url: '/sales/order2B/auditCancel/' + id,
    method: 'post'
  })
}
//财务审核B2B订单
export function financeConfirm(id){
  return request({
    url: '/sales/order2B/financeConfirm/' + id,
    method: 'post'
  })
}
// 订单关闭
export function closeOrder(data) {
  return request({
    url: '/sales/order2B/closeByHandle',
    method: 'post',
    data: data
  })
}
// 发货
export function makeInvoice(data) {
  return request({
    url: '/sales/order2B/makeInvoice',
    method: 'post',
    data: data
  })
}
// 发货
export function delivery(data) {
  return request({
    url: '/sales/order2B/delivery',
    method: 'post',
    data: data
  })
}
// 收款
export function receipt(data) {
  return request({
    url: '/sales/order2B/receipt',
    method: 'post',
    data: data
  })
}

//撤销收款
export function receiptCancel(id){
  return request({
    url: '/sales/order2B/receiptCancel/' + id,
    method: 'post'
  })
}
// 确认收款
export function receiptConfirm(data) {
  return request({
    url: '/sales/order2B/receiptConfirm',
    method: 'post',
    data: data
  })
}
// 延迟确认收款
export function receiptConfirmDelay(data) {
  return request({
    url: '/sales/order2B/receiptConfirmDelay',
    method: 'post',
    data: data
  })
}
// 更新B2B物流信息
export function updateLogistics2B(id) {
  return request({
    url: '/sales/order2B/updateLogistics2B/' + id,
    method: 'post'
  })
}

// 获取操作状态数据
export function findOptStatusData(id) {
  return request({
    url: '/sales/order2B/findOptStatusData/' + id,
    method: 'post'
  })
}

export function sendOrder(id) {
  return request({
    url: '/sales/order2B/sendOrder/' + id,
    method: 'post'
  })
}
